home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / Commander Sets / 4D Speech Pack / 4D Speech Pack.rsrc / TEXT_32648_†SP Voice Text.txt < prev    next >
Encoding:
Text File  |  1994-09-14  |  3.8 KB  |  66 lines

  1. SP Voice Text (reference; lines; first; last; flags) -> err
  2.  
  3. reference   integer       specifys the channel you want to close. Use the
  4.                                     reference number obtained from the
  5.                                    SP Open Voice function.
  6. lines           text           is a text variable or field which contains the
  7.                                    text you want to be spoken.
  8. first           integer       specifys on which location to start reading.
  9. last            integer       specifying on which location to stop reading.
  10.                                    This is the position of the last character selected
  11.                                     plus one!
  12. flags          long int       allows you to control the behaviours of the
  13.                                    voice. You can pass the (sum of the) numbers
  14.                                    below:
  15.                   0  Normal behaviour
  16.                   1  No ending prodosy (cadance at end of statement is turned
  17.                       off)
  18.                   2  No speech interrupt (passing other text while speaking
  19.                       returns an error)
  20.                   4  Start and pause immediatly (speech starts after call to
  21.                      SP Voice Cont)
  22.                   (These are implemented with Speech Manager 1.1.1, see
  23.                   the SpeakBuffer function in the Speech Manager
  24.                   documentation.)
  25. err             integer       returns the error which occured. 
  26.                                     A value of zero indicates no error occured. See 
  27.                                     below for a list of possible errors.
  28.  
  29. Speaks the text you pass using the voice of the open speech channel you specify. You can also specify at which location to start and stop speaking.
  30.  
  31. The ‚Äùfirst‚Äú and ‚Äùlast‚Äú parameters work like the parameters used with the standard GET HIGHLIGHT and HIGHLIGHT TEXT 4D commands.
  32. The specified selection of the text will be spoken and control will return to 4D as soon as the voice synthesizer is started speaking.
  33. If one of the ‚Äùfirst‚Äú and ‚Äùlast‚Äú parameters is negative, zero or if they are equal the full text will be read to you. And, ofcourse, also when ‚Äùfirst‚Äú is one (1) and ‚Äùlast‚Äú is the length of the text plus one.
  34.  
  35. The lines you pass and which will be spoken are copied and this copy is used to speak. If you specify a valid ‚Äùfirst‚Äú and ‚Äùlast‚Äú parameter only the text in between these two positions will be copied, in order to save memory. You can then do whatever you want, including unload/cancel any record or clearing the variable or field after calling this function.
  36. If the specified speech channel is already speaking text, this will be stopped immediatly, unless the ‚ÄùNo speech interrupt‚Äú flag was set when the previous text was passed. Then an error is returned (-242).
  37.  
  38. Examples:
  39.   `these all have the same effect
  40.   $err := SP Voice Text ($speechref;[File 1]Description;0;0;0)
  41.   $err := SP Voice Text ($speechref;[File 1]Description;1;
  42.                Length([File 1]Description) + 1;0)
  43.  
  44.   `and this one will ignore the last character
  45.   $err := SP Voice Text ($speechref;[File 1]Description;1;
  46.                Length([File 1]Description);0)
  47.  
  48.   `and this one will only say "Speech Manager"
  49.   $lines := "Testing Speech Manager"
  50.   $err := SP Voice Text ($speechref;$lines;9;Length($lines) + 1;0)
  51.  
  52. Possible errors:
  53.         0  No Error
  54.       -4  Speech Pack can not be used (Speech Mgr not available)
  55.   -108  Not enough memory to load voice into memory
  56.   -111  Tried to dispose an already disposed non-relocatable block
  57.   -205  Bad channel, speaker volume is too low or Speech Pack disabled
  58.   -231  Feature not implemented on synthesizer
  59.   -242  Voice synthesizer is not ready
  60.   -247  Input text bad
  61. -3000  Invalid SpeechChannel parameter, probably invalid reference
  62.             number
  63.  
  64.  
  65.  
  66.